﻿

function hideAllPanel()
{
    hideControl('pEdit');
    hideControl('pTreeView');
    hideControl('pSearch');
    hideControl('pSearch2');
    hideControl('pShare');
    hideControl('pAddGuide');
    hideControl('pShared');
    hideControl('pPopupShare');
}

function showAllPanel()
{
    showControl('pEdit');
    showControl('pTreeView');
    showControl('pSearch');
    showControl('pSearch2');
    showControl('pShare');
    showControl('pAddGuide');
    showControl('pShared');
    showControl('pPopupShare');
}

function showAllEditButton()
{
    showControl('btAdd');
    showControl('btEdit');
    showControl('btDelete');
    showControl('btCancel');
}

function hideAllEditButton()
{
    hideControl('btAdd');
    hideControl('btEdit');
    hideControl('btDelete');
    hideControl('btCancel');
}

function showControl(idPanel)
{
    var panel = document.getElementById(idPanel);
    //panel.style.display = 'inline';
    panel.style.display = 'block';
}

function hideControl(idPanel)
{
    var panel = document.getElementById(idPanel);
    panel.style.display = 'none';    
}

function setValue(id, value)
{
    var control = document.getElementById(id); 
    control.value = value;
}

function loadCatelogy()
{
    var request = new XMLHttpRequest();
    request.open("POST", "Default.aspx", true);
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.setRequestHeader("action", "getCategory");
    request.send();    
}



function closePopupShare()
{
    hideControl('pPopupShare');
}

function showDefaulPanelForUser()
{
    showDefaulPanelForGuest()
    showControl('pTreeView');
}

function showDefaulPanelForGuest()
{
    hideAllPanel();
    showControl('pSearch');
}